
package com.feib.soeasy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * @title (#)ColumnValidateError.java<br>
 * @description <br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2010/11/24 create by Jimmy Liu<br>
 */
@Entity
@Table(name = "COLUMN_ERROR")
public class ColumnValidateError extends BaseEntity  {

    private static final long serialVersionUID = -8571009150652796935L;
    
    /**
     * PK in Table
     */
    private Long columnValidateErrorPk;
    
    /**
     * 哪一個檔案
     */
    private UploadFile uploadFile;
    
    /**
     * 第幾行錯誤
     */
    private Long lineNumber;
    
    /**
     * 錯誤欄位
     */
    private String columnName;
    
    /**
     * 錯誤原因
     */
    private String errorMessage;
    
    /**
     * 程式錯誤原因
     */
    private String exceptionMessage;

    
    /**
     * @return the columnValidateErrorPk
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="COLUMN_VALIDATE_ERROR_PK", nullable=false)
    public Long getColumnValidateErrorPk() {
        return columnValidateErrorPk;
    }

    
    /**
     * @param columnValidateErrorPk the columnValidateErrorPk to set
     */
    public void setColumnValidateErrorPk(Long columnValidateErrorPk) {
        this.columnValidateErrorPk = columnValidateErrorPk;
    }


    
    /**
     * @return the uploadFile
     */
    @ManyToOne
    @JoinColumn(name="UPLOAD_FILE_PK")
    public UploadFile getUploadFile() {
        return uploadFile;
    }


    
    /**
     * @param uploadFile the uploadFile to set
     */
    public void setUploadFile(UploadFile uploadFile) {
        this.uploadFile = uploadFile;
    }

    
    /**
     * @return the lineNumber
     */
    @Column(name="LINE_NUMBER")
    public Long getLineNumber() {
        return lineNumber;
    }

    
    /**
     * @param lineNumber the lineNumber to set
     */
    public void setLineNumber(Long lineNumber) {
        this.lineNumber = lineNumber;
    }

    
    /**
     * @return the columnName
     */
    @Column(name="COLUMN_NAME", length=40)
    public String getColumnName() {
        return columnName;
    }

    
    /**
     * @param columnName the columnName to set
     */
    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    
    /**
     * @return the errorMessage
     */
    @Column(name="ERROR_MESSAGE", length=255)
    public String getErrorMessage() {
        return errorMessage;
    }

    
    /**
     * @param errorMessage the errorMessage to set
     */
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    
    /**
     * @return the exceptionMessage
     */
    @Column(name="EXCEPTION_MESSAGE", length=255)
    public String getExceptionMessage() {
        return exceptionMessage;
    }

    
    /**
     * @param exceptionMessage the exceptionMessage to set
     */
    public void setExceptionMessage(String exceptionMessage) {
        this.exceptionMessage = exceptionMessage;
    }


    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return String.format("ColumnValidateError [columnValidateErrorPk=%s, uploadFile=%s, lineNumber=%s, columnName=%s, errorMessage=%s, exceptionMessage=%s]", columnValidateErrorPk, uploadFile, lineNumber, columnName, errorMessage, exceptionMessage);
    }


}
